package com.example.tests;

import java.util.Collections;
import java.util.List;

import org.testng.Assert;
import org.testng.annotations.Test;

import com.example.fw.Contact;

public class ContactCreationTests extends TestBase{
	
	@Test(dataProvider = "randomValidContactGenerator")
	public void shouldCreateContactWithValidData(Contact contact) {
		List<Contact> oldContacts = app.getContactHelper().getContacts();
		app.getContactHelper().createContact(contact);
		List<Contact> newContacts = app.getContactHelper().getContacts();
		oldContacts.add(contact);
		Collections.sort(oldContacts);
		Assert.assertEquals(oldContacts, newContacts);
	}
}
